home *** CD-ROM | disk | FTP | other *** search
-
-
- On Mon, 20 Feb 1995, Daithi Padraig Ocuinn wrote:
-
- > I have written a program in Amos which involves a `laser beam`
- > being fired from one part of the screen to another.
- > To do this I just work out dy and dx ( one of these values
- > will be 1) and add them to the original points until the
- > destination is reached or it hits something.
- >
- > It works fine when run through the editor, yet when compiled...
- > does not. Why??? I use real numbers for dx and dy - maybe
- > the compiler cannot deal with these or something?
- > The beam does not go in the right direction at all.
-
- Try not to use anything but integers for games. Many may disagree, but
- it is simply the only way to go. Especially since the compiler doesn't
- work well with floats and not always with math functions. In airTaxi, I
- had a purple sphere magnet that would pull all the cars toward itself.
- This involved some basic vector and magnetism functions, but I used all
- integers to do it. Simply have an X value that represents 1/100th of a
- pixel, same with Y. Then set dx or dy to 100 and the other to cos/sin * 100.
- Your routine will perform faster too. If you need more accuracy, use 256
- or more instead of 100. Just divide by the number to get the real pixel
- position.
-
- In my game, I also had to abort at the beginning if SQR(4)<>2. Why?
- Because the compiler would 20% of the time not include the math libraries
- or something like this. My purple sphere would not attract anything at
- all - this is how I noticed the problem.
-
- Hope this helps - Dave May
-
- >
- > Has anyone got a list of inconsistencies in compiler/interpreter
- > operation? This is driving me up the wall.
- >
- > D.O`Cuinn
- >
-
-